package com.xbongbong.paas.pojo.dto;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.paas.toolbox.wrap.BaseDTO;
import com.xbongbong.paas.toolbox.wrap.QueryIgnore;
import com.xbongbong.pro.formdata.pojo.SaasNeedRedundantAttrPojo;
import com.xbongbong.pro.user.pojo.ReturnUserAndDepartmentPojo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Map;

@Setter
@Getter
@ToString
public class OuterLinkAddDTO extends BaseDTO {

    private static final long serialVersionUID = 890245517899327058L;

    @NotNull(message = "{dto.msg.outerLinkAdd.formId.NotNull}")
    private Long formId;

    @NotNull(message = "{dto.msg.outerLinkAdd.token.NotNull}")
    private String token;

    @NotNull(message = "{dto.msg.outerLinkAdd.appId.NotNull}")
    private Long appId;

    @NotNull(message = "{dto.msg.outerLinkAdd.menuId.NotNull}")
    @Getter(onMethod_ = {@QueryIgnore})
    private Long menuId;

    /**
     * 编号，流水号
     */
    @Length(max = 50, message = "{dto.msg.outerLinkAdd.serialNo.Length}")
    private String serialNo;
    /**
     * 组号
     */
    private String groupNumber;
    /**
     * 负责人
     */
    private List<ReturnUserAndDepartmentPojo> ownerId;
    /**
     * 协同人
     */
    private List<ReturnUserAndDepartmentPojo> coUserId;
    /**
     * 可见部门集合
     */
    private List<Object> visbleDept;
    /**
     * 可见人集合
     */
    private List<Object> visbleUser;

    /**
     * 所属部门
     */
    private Long departmentId;
    /**
     *关联客户id
     */
    private List<Integer> dataIdList;

    private JSONObject dataList;
    /**
     * saas标记
     * TODO  后面应该限制非空
     */
    @NotNull(message = "{dto.msg.outerLinkAdd.saasMark.NotNull}")
    private Integer saasMark;
    /**
     * saas业务类型
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer businessType;

    /**
     * saas子业务类型
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer subBusinessType;

    /**
     * saas所需的特殊传参pojo
     */
    @Valid
    private SaasNeedRedundantAttrPojo saasNeedRedundantAttrPoJo;

    /**
     * 是否是导入 1是导入
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer isImport;
    /**
     * 字段容器
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Map<String, FieldAttrEntity> explainMap;

    /**
     * 流程创建人id
     */
    private String processCreatorId;
    /**
     * 是否是从业务规则来的 1：是
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer isBusinessRule;

    /**
     * 资金管理中 金额明细详情
     */
    private JSONArray amountDetail;

    private Boolean isTotalPaymentSheetAmount;

    private Integer isOldProgressData;

    public OuterLinkAddDTO(){
        departmentId = 0L;
        saasNeedRedundantAttrPoJo = new SaasNeedRedundantAttrPojo();
        isImport = 0;
    }

}
